const calculateMinWidth = (total, count) => {
    if (total === 0) {
        throw new Error("Total cannot be zero."); // 抛出错误，避免除以零
    }
    return (count / total) * 100; // 计算百分比
}

const a = 112;
const b = 4;
const c = 0;
const total = a + b + c; // 计算总和

// 单独计算每个值的百分比
const resultA = calculateMinWidth(total, 0);
const resultB = calculateMinWidth(total, 0);
const resultC = calculateMinWidth(total, 0);

console.log(`Percentage of a: ${resultA}`); // 输出: Percentage of a: 96.55172413793103
console.log(`Percentage of b: ${resultB}`); // 输出: Percentage of b: 3.4482758620689653
console.log(`Percentage of c: ${resultC}`); // 输出: Percentage of c: 0